﻿using System.Net.NetworkInformation;
using tuimg;
using tuimg.element;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            //var img = new TuimgJpeg("1.jpg");
            var png = new TuimgPng("a.png");
            var icon2 = new TuimgIco();
            icon2.InsertBmp(png);
            icon2.ToStream(File.Create("sss.ico"));

            var and = png.ToAndGrid();

            var f2 = new TuimgBmp(and.Width, and.Height);
            f2.DrawGrid(and, TuimgColor.Black);
            f2.ToStream(File.Create("t1.bmp"));

            var newimg = new TuimgBmp(300, 300);
            using (var mifont = new TuimgFont("MiSans-Regular.ttf"))
            {
                var g = new TuimgGrid(300, 300);
                var x = 30;
                foreach (var i in "A13")
                {
                    if (i != ' ')
                    {
                        var path = mifont.ReadPath(i);
                        var g1 = path.ToGrid_ScaleHeight(72);
                        g.BottomCross(g1, x);
                        x += g1.Width;
                    }
                    x += 2;
                }
                newimg.DrawGrid(62, 10, g.CopyTrim());
            }
            using (var b = newimg.ToStream())
            using (var f = File.Create("a.bmp")) b.CopyTo(f);
        }
    }
}
